package com.wl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wl.dao.MemberDao;
import com.wl.pojo.Member;
import com.wl.service.MemberService;

@Service("memberService")
public class MemberServiceImpl implements MemberService {

	@Resource
	private MemberDao memberDao;

	@Override // 登录
	public Member login(String memName, String password) {
		return memberDao.memLogin(memName, password);
	}

	@Override // 查看所有
	public List<Member> getMemAll() {
		return memberDao.selectMemAll();
	}

	@Override // 根据id查找
	public Member getMemById(int memId) {
		return memberDao.selectMemById(memId);
	}

	@Override // 根据名称查找
	public Member getMemByName(String memName) {
		return memberDao.selectMemByName(memName);
	}

	@Override // 根据找回密码提示和找回密码答案查找
	public Member getMemByQueAndAns(String que, String ans) {
		return memberDao.selectMemByQueAndAns(que, ans);
	}

	@Override // 添加
	public int addMem(Member mem) {
		return memberDao.insertMem(mem);
	}

	@Override // 修改
	public int alterMem(Member mem) {
		return memberDao.updateMem(mem);
	}

	@Override // 根据id删除
	public int removeMemById(int memId) {
		return memberDao.deleteMemById(memId);
	}

}
